package com.ldatum.crm.serviceImpl;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

import com.ldatum.crm.dao.TScheduleDao;
import com.ldatum.crm.daoImpl.TScheduleDaoImpl;
import com.ldatum.crm.domain.TSchedule;
import com.ldatum.crm.service.TScheduleService;

public class TScheduleServiceImpl implements TScheduleService {

	TScheduleDao scheduleDao =  new TScheduleDaoImpl();
	@Override
	public TSchedule findById(Integer id) {
		return scheduleDao.findById(id);
	}

	@Override
	public void save(TSchedule schedule) {
		schedule.setCreateTime(new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").format(new Date()));
		scheduleDao.save(schedule);
	}

	@Override
	public void update(TSchedule schedule) {
		scheduleDao.update(schedule);
	}

	@Override
	public List<TSchedule> list(Class<TSchedule> class1, String creater) {
		
		return scheduleDao.list(class1,creater);
	}

	@Override
	public List<TSchedule> findUnFinished(String fullname) {

		return scheduleDao.findUnFinished(fullname);
	}

}
